/***********************************************************************************/
/* Code license:  GNU General Public License v3                                    */
/* Main page:     https://code.google.com/p/library-cross-platform/                */
/* Issue tracker: https://code.google.com/p/library-cross-platform/issues/list     */
/***********************************************************************************/
#ifndef __QPOPUP_H__
#define __QPOPUP_H__

#include <QLabel>

class QPopup : public QLabel
{
    Q_OBJECT
protected:
    explicit QPopup();
public:
    virtual ~QPopup();

    void setBackground(QColor color = QColor(223,225, 91, 255));

public:
    static QPopup *getInstance() {
      if(pPopup == 0) {
        pPopup = new QPopup();
      }
      return pPopup;
    }

    static void deleteObject() {
      if(pPopup != 0) {
        delete pPopup; pPopup = 0;
      }
    }

    virtual void showPopup();
    virtual void hidePopup();
    virtual void text(const QString &);

protected:
   void show();
   void hide();


   virtual bool eventFilter(QObject *obj, QEvent *event);

protected:
    static QPopup *pPopup;

signals:

public slots:
//   virtual void focusUpdated(QWidget*, QWidget*);

};

#endif // __QPOPUP_H__
